Setup
Read in data
True network structures

# must run analyze/convert_combine_csvs.Rmd first
data_draw <- read.csv(paste0(draw_dir, "network_learn2_draw_data.csv"))
data_ego <- read.csv(paste0(ego_dir, "network_learn2_ego_data.csv"))
ego_els <- read.csv(paste0(ego_dir,"network_learn2_ego_edgelists.csv"))
data_demo <- read.csv(paste0(ego_dir,"network_learn2_demographics.csv"))
Analyses
accuracy_draw <- ddply(data_draw, .(ID, Structure, Condition),
summarise, correct=mean(correct))
summ_accuracy_draw <- summarySEwithin(data = data_draw,
measurevar = "correct",
betweenvars = "Condition",
withinvars = c("Structure"),
idvar = "ID",
na.rm = T)
mylm <- lmerTest::lmer(correct ~ Structure + (1|ID),
data=accuracy_draw)
knitr::kable(anova(mylm))
| Structure |
3.426569 |
3.426569 |
1 |
239 |
376.6133 |
0 |
# which network structure did participants learn better?
# - natural
mymeans <- emmeans::emmeans(mylm, "Structure")
knitr::kable(confint(mymeans))
| natural |
0.9284722 |
0.0072499 |
443.5374 |
0.9142238 |
0.9427207 |
| unnatural |
0.7594907 |
0.0072499 |
443.5374 |
0.7452423 |
0.7737392 |
knitr::kable(pairs(mymeans))
| natural - unnatural |
0.1689815 |
0.0087075 |
239 |
19.40653 |
0 |



## quartz_off_screen
## 3
## quartz_off_screen
## 2
Check order effects
d <- ddply(data_draw, .(ID, Structure, Condition, Section),
summarise, correct=mean(correct))
summarySEwithin(data = d,
measurevar = "correct",
betweenvars = "Condition",
withinvars = c("Structure", "Section"),
idvar = "ID",
na.rm = T)
## Automatically converting the following non-factors to factors: Section
## Condition Structure Section N correct sd se ci
## 1 social natural 1 92 0.9018015 0.07646270 0.007971788 0.01583498
## 2 social natural 2 148 0.9450513 0.07266279 0.005972844 0.01180373
## 3 social unnatural 1 148 0.7429117 0.07266279 0.005972844 0.01180373
## 4 social unnatural 2 92 0.7861614 0.07646270 0.007971788 0.01583498
accuracy_draw_sect <- summarySEwithin(data = data_draw,
measurevar = "correct",
betweenvars = "Condition",
withinvars = c("Structure", "Section", "ID"),
na.rm = T)
## Automatically converting the following non-factors to factors: Section, ID
summ_accuracy_draw_sect <- summarySEwithin(data = data_draw,
measurevar = "correct",
betweenvars = "Condition",
withinvars = c("Structure", "Section"),
idvar = "ID",
na.rm = T)
## Automatically converting the following non-factors to factors: Section
mylm <- lmerTest::lmer(correct ~ Structure*Section + (1|ID),
data=accuracy_draw_sect)
knitr::kable(anova(mylm))
| Structure |
2.8645784 |
2.8645784 |
1 |
238 |
347.43978 |
0.0000000 |
| Section |
0.2122442 |
0.2122442 |
1 |
238 |
25.74274 |
0.0000008 |
| Structure:Section |
0.0256530 |
0.0256530 |
1 |
238 |
3.11141 |
0.0790286 |
# Did participants perform better in section 1 or section 2?
# - No difference for unnatural
# - Better in Section 2 for natural
mymeans <- emmeans::emmeans(mylm, ~Section|Structure)
knitr::kable(confint(mymeans))
| 1 |
natural |
0.8888889 |
0.0114765 |
431.8903 |
0.8663322 |
0.9114456 |
| 2 |
natural |
0.9530781 |
0.0090484 |
431.8903 |
0.9352937 |
0.9708624 |
| 1 |
unnatural |
0.7509384 |
0.0090484 |
431.8903 |
0.7331541 |
0.7687228 |
| 2 |
unnatural |
0.7732488 |
0.0114765 |
431.8903 |
0.7506921 |
0.7958055 |
knitr::kable(pairs(mymeans))
| 1 - 2 |
natural |
-0.0641892 |
0.0146145 |
431.8903 |
-4.392167 |
0.0000141 |
| 1 - 2 |
unnatural |
-0.0223104 |
0.0146145 |
431.8903 |
-1.526594 |
0.1275941 |
# Did participants learn the natural network better than the unnatural network in oth sections?
# - Yes
mymeans <- emmeans::emmeans(mylm, ~Structure|Section)
knitr::kable(confint(mymeans))
| natural |
1 |
0.8888889 |
0.0114765 |
431.8903 |
0.8663322 |
0.9114456 |
| unnatural |
1 |
0.7509384 |
0.0090484 |
431.8903 |
0.7331541 |
0.7687228 |
| natural |
2 |
0.9530781 |
0.0090484 |
431.8903 |
0.9352937 |
0.9708624 |
| unnatural |
2 |
0.7732488 |
0.0114765 |
431.8903 |
0.7506921 |
0.7958055 |
knitr::kable(pairs(mymeans))
| natural - unnatural |
1 |
0.1379505 |
0.0146145 |
431.8903 |
9.439307 |
0 |
| natural - unnatural |
2 |
0.1798293 |
0.0146145 |
431.8903 |
12.304880 |
0 |

Ego Network Effects
# combine drawing data and ego network meaures
data_egodraw <- left_join(accuracy_draw, data_ego)
## Joining, by = "ID"
knitr::kable(head(data_egodraw))
| 1 |
natural |
social |
0.7777778 |
5 |
0.7500000 |
0.3822222 |
0.4000000 |
14 |
23 |
1.609438 |
-0.9617531 |
2.800000 |
4.600000 |
| 1 |
unnatural |
social |
0.7777778 |
5 |
0.7500000 |
0.3822222 |
0.4000000 |
14 |
23 |
1.609438 |
-0.9617531 |
2.800000 |
4.600000 |
| 2 |
natural |
social |
1.0000000 |
9 |
0.7500000 |
0.2788066 |
0.6086957 |
23 |
37 |
2.197225 |
-1.2772370 |
2.555556 |
4.111111 |
| 2 |
unnatural |
social |
0.6944444 |
9 |
0.7500000 |
0.2788066 |
0.6086957 |
23 |
37 |
2.197225 |
-1.2772370 |
2.555556 |
4.111111 |
| 3 |
natural |
social |
0.9722222 |
10 |
0.7259259 |
0.2600722 |
0.5730337 |
25 |
39 |
2.302585 |
-1.3467959 |
2.500000 |
3.900000 |
| 3 |
unnatural |
social |
0.7222222 |
10 |
0.7259259 |
0.2600722 |
0.5730337 |
25 |
39 |
2.302585 |
-1.3467959 |
2.500000 |
3.900000 |
Degree
Natural structure only
Disappears when constraint added as a covariate
data_egodraw$zdegree <- scale(data_egodraw$degree, center=T, scale = T)
mylm <- lmerTest::lmer(correct ~ Structure*degree + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
0.4780916 |
0.4780916 |
1 |
238 |
53.106876 |
0.0000000 |
| degree |
0.0700445 |
0.0700445 |
1 |
238 |
7.780612 |
0.0057084 |
| Structure:degree |
0.0319298 |
0.0319298 |
1 |
238 |
3.546797 |
0.0608800 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="degree"))
| natural |
0.0041466 |
0.0012339 |
443.4978 |
0.0017216 |
0.0065716 |
| unnatural |
0.0013402 |
0.0012339 |
443.4978 |
-0.0010848 |
0.0037652 |
mylm <- lmerTest::lmer(correct ~ Structure*log_degree + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
0.0663911 |
0.0663911 |
1 |
238 |
7.392435 |
0.0070323 |
| log_degree |
0.0978775 |
0.0978775 |
1 |
238 |
10.898347 |
0.0011103 |
| Structure:log_degree |
0.0370449 |
0.0370449 |
1 |
238 |
4.124833 |
0.0433699 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="log_degree"))
| natural |
0.048898 |
0.0126781 |
444.5514 |
0.0239816 |
0.0738144 |
| unnatural |
0.017700 |
0.0126781 |
444.5514 |
-0.0072164 |
0.0426164 |
mylm <- lmerTest::lmer(correct ~ Structure*zdegree + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
3.4265689 |
3.4265689 |
1 |
238 |
380.626542 |
0.0000000 |
| zdegree |
0.0700445 |
0.0700445 |
1 |
238 |
7.780612 |
0.0057084 |
| Structure:zdegree |
0.0319298 |
0.0319298 |
1 |
238 |
3.546797 |
0.0608800 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="zdegree"))
| natural |
0.0241268 |
0.0071792 |
443.4978 |
0.0100172 |
0.0382363 |
| unnatural |
0.0077977 |
0.0071792 |
443.4978 |
-0.0063118 |
0.0219073 |
"With constraint as a covariate:"
## [1] "With constraint as a covariate:"
mylm <- lmerTest::lmer(correct ~ Structure*degree + log_constraint + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
0.4780916 |
0.4780916 |
1 |
238 |
53.1068757 |
0.0000000 |
| degree |
0.0067913 |
0.0067913 |
1 |
237 |
0.7543888 |
0.3859689 |
| log_constraint |
0.0042915 |
0.0042915 |
1 |
237 |
0.4767075 |
0.4905931 |
| Structure:degree |
0.0319298 |
0.0319298 |
1 |
238 |
3.5467967 |
0.0608800 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="degree"))
| natural |
0.0030386 |
0.0020249 |
309.4833 |
-0.0009457 |
0.0070229 |
| unnatural |
0.0002321 |
0.0020249 |
309.4833 |
-0.0037522 |
0.0042164 |
## `geom_smooth()` using formula 'y ~ x'

## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'

## `geom_smooth()` using formula 'y ~ x'

Strength
Non-normalized
mylm <- lmerTest::lmer(correct ~ Structure*strength_close + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
0.5343006 |
0.5343006 |
1 |
238 |
58.976251 |
0.0000000 |
| strength_close |
0.0752631 |
0.0752631 |
1 |
238 |
8.307567 |
0.0043090 |
| Structure:strength_close |
0.0183290 |
0.0183290 |
1 |
238 |
2.023165 |
0.1562252 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="strength_close"))
| natural |
0.0015630 |
0.0004954 |
444.3721 |
0.0005894 |
0.0025366 |
| unnatural |
0.0007097 |
0.0004954 |
444.3721 |
-0.0002639 |
0.0016833 |
mylm <- lmerTest::lmer(correct ~ Structure*strength_freq + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
0.4561104 |
0.4561104 |
1 |
238 |
50.469281 |
0.0000000 |
| strength_freq |
0.0818157 |
0.0818157 |
1 |
238 |
9.053029 |
0.0029045 |
| Structure:strength_freq |
0.0236135 |
0.0236135 |
1 |
238 |
2.612865 |
0.1073248 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="strength_freq"))
| natural |
0.0010358 |
0.0003071 |
444.4305 |
0.0004323 |
0.0016393 |
| unnatural |
0.0004347 |
0.0003071 |
444.4305 |
-0.0001688 |
0.0010382 |
## `geom_smooth()` using formula 'y ~ x'

## `geom_smooth()` using formula 'y ~ x'

Normalized
No effect
mylm <- lmerTest::lmer(correct ~ Structure*strength_close_norm + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
0.1584795 |
0.1584795 |
1 |
238 |
17.5653265 |
0.0000392 |
| strength_close_norm |
0.0007150 |
0.0007150 |
1 |
238 |
0.0792516 |
0.7785588 |
| Structure:strength_close_norm |
0.0272060 |
0.0272060 |
1 |
238 |
3.0154239 |
0.0837699 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="strength_close_norm"))
| natural |
-0.0183356 |
0.0225497 |
440.3831 |
-0.0626541 |
0.0259829 |
| unnatural |
0.0285100 |
0.0225497 |
440.3831 |
-0.0158085 |
0.0728285 |
mylm <- lmerTest::lmer(correct ~ Structure*strength_freq_norm + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
0.1465191 |
0.1465191 |
1 |
238 |
16.3718884 |
0.0000704 |
| strength_freq_norm |
0.0005597 |
0.0005597 |
1 |
238 |
0.0625432 |
0.8027363 |
| Structure:strength_freq_norm |
0.0445468 |
0.0445468 |
1 |
238 |
4.9776146 |
0.0266097 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="strength_freq_norm"))
| natural |
-0.0201998 |
0.0178706 |
439.5091 |
-0.0553223 |
0.0149226 |
| unnatural |
0.0273732 |
0.0178706 |
439.5091 |
-0.0077492 |
0.0624957 |
# overall strength
data_egodraw$strength <- data_egodraw$strength_close_norm + data_egodraw$strength_freq_norm
mylm <- lmerTest::lmer(correct ~ Structure*strength + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
0.1526566 |
0.1526566 |
1 |
238 |
17.1159004 |
0.0000488 |
| strength |
0.0008858 |
0.0008858 |
1 |
238 |
0.0993117 |
0.7529333 |
| Structure:strength |
0.0517915 |
0.0517915 |
1 |
238 |
5.8068794 |
0.0167236 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="strength"))
| natural |
-0.0140611 |
0.0118851 |
439.1599 |
-0.0374199 |
0.0092977 |
| unnatural |
0.0200763 |
0.0118851 |
439.1599 |
-0.0032824 |
0.0434351 |
## `geom_smooth()` using formula 'y ~ x'

## `geom_smooth()` using formula 'y ~ x'

## `geom_smooth()` using formula 'y ~ x'

## `geom_smooth()` using formula 'y ~ x'
Constraint
Natural structure only
No effect when degree included as covariate
mylm <- lmerTest::lmer(correct ~ Structure*log_constraint + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
0.1693206 |
0.1693206 |
1 |
238 |
19.016379 |
0.0000193 |
| log_constraint |
0.0667221 |
0.0667221 |
1 |
238 |
7.493556 |
0.0066596 |
| Structure:log_constraint |
0.0553747 |
0.0553747 |
1 |
238 |
6.219123 |
0.0133178 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="log_constraint"))
| natural |
-0.0549141 |
0.0148944 |
442.2287 |
-0.0841866 |
-0.0256416 |
| unnatural |
-0.0102285 |
0.0148944 |
442.2287 |
-0.0395010 |
0.0190440 |
"With Degree as a covariate:"
## [1] "With Degree as a covariate:"
mylm <- lmerTest::lmer(correct ~ Structure*log_constraint + degree + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
0.1693206 |
0.1693206 |
1 |
238 |
19.0163784 |
0.0000193 |
| log_constraint |
0.0042446 |
0.0042446 |
1 |
237 |
0.4767075 |
0.4905931 |
| degree |
0.0067170 |
0.0067170 |
1 |
237 |
0.7543888 |
0.3859689 |
| Structure:log_constraint |
0.0553747 |
0.0553747 |
1 |
238 |
6.2191233 |
0.0133178 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="log_constraint"))
| natural |
-0.0380606 |
0.0244644 |
308.7271 |
-0.0861986 |
0.0100775 |
| unnatural |
0.0066250 |
0.0244644 |
308.7271 |
-0.0415130 |
0.0547631 |
## `geom_smooth()` using formula 'y ~ x'

## `geom_smooth()` using formula 'y ~ x'
Betweenness
No effect
mylm <- lmerTest::lmer(correct ~ Structure*betweenness + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
0.3243062 |
0.3243062 |
1 |
238 |
35.9183816 |
0.0000000 |
| betweenness |
0.0034952 |
0.0034952 |
1 |
238 |
0.3871067 |
0.5344198 |
| Structure:betweenness |
0.0256151 |
0.0256151 |
1 |
238 |
2.8369920 |
0.0934274 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="betweenness"))
| natural |
0.0426782 |
0.0283277 |
440.5994 |
-0.0129960 |
0.0983524 |
| unnatural |
-0.0144403 |
0.0283277 |
440.5994 |
-0.0701145 |
0.0412339 |
## `geom_smooth()` using formula 'y ~ x'

## `geom_smooth()` using formula 'y ~ x'
Transitivity
No effect
mylm <- lmerTest::lmer(correct ~ Structure*transitivity + (1|ID),
data=data_egodraw)
knitr::kable(anova(mylm))
| Structure |
0.5967008 |
0.5967008 |
1 |
238 |
65.7556876 |
0.0000000 |
| transitivity |
0.0003784 |
0.0003784 |
1 |
238 |
0.0416954 |
0.8383760 |
| Structure:transitivity |
0.0147775 |
0.0147775 |
1 |
238 |
1.6284626 |
0.2031597 |
knitr::kable(emmeans::emtrends(mylm, "Structure", var="transitivity"))
| natural |
-0.0209835 |
0.0349006 |
440.9795 |
-0.0895757 |
0.0476088 |
| unnatural |
0.0323940 |
0.0349006 |
440.9795 |
-0.0361983 |
0.1009862 |
## `geom_smooth()` using formula 'y ~ x'

## `geom_smooth()` using formula 'y ~ x'
Degree, strength, and constraint are highly correlated, and thus redundant. As such, it is unclear which is responsible for learning accuracy.
c <- colnames(data_ego)
knitr::kable(cor(select(data_ego, c[c!="ID"])))
| degree |
1.0000000 |
0.2059668 |
-0.7175133 |
-0.0857242 |
0.9621594 |
0.9798564 |
0.9348114 |
-0.8523706 |
-0.1736306 |
-0.3847299 |
| betweenness |
0.2059668 |
1.0000000 |
-0.6376353 |
-0.8153321 |
0.1734679 |
0.1739696 |
0.2742833 |
-0.6057811 |
-0.1788252 |
-0.3053730 |
| constraint |
-0.7175133 |
-0.6376353 |
1.0000000 |
0.4728544 |
-0.6844266 |
-0.7073094 |
-0.8533512 |
0.9439494 |
0.2304070 |
0.4401194 |
| transitivity |
-0.0857242 |
-0.8153321 |
0.4728544 |
1.0000000 |
-0.0490590 |
-0.0469216 |
-0.0984351 |
0.4717161 |
0.1465413 |
0.2365039 |
| strength_close |
0.9621594 |
0.1734679 |
-0.6844266 |
-0.0490590 |
1.0000000 |
0.9610538 |
0.9010063 |
-0.8056920 |
0.0647687 |
-0.2955944 |
| strength_freq |
0.9798564 |
0.1739696 |
-0.7073094 |
-0.0469216 |
0.9610538 |
1.0000000 |
0.9277667 |
-0.8290160 |
-0.1142585 |
-0.2235990 |
| log_degree |
0.9348114 |
0.2742833 |
-0.8533512 |
-0.0984351 |
0.9010063 |
0.9277667 |
1.0000000 |
-0.9017761 |
-0.1977073 |
-0.4151050 |
| log_constraint |
-0.8523706 |
-0.6057811 |
0.9439494 |
0.4717161 |
-0.8056920 |
-0.8290160 |
-0.9017761 |
1.0000000 |
0.2336094 |
0.4626403 |
| strength_close_norm |
-0.1736306 |
-0.1788252 |
0.2304070 |
0.1465413 |
0.0647687 |
-0.1142585 |
-0.1977073 |
0.2336094 |
1.0000000 |
0.3956794 |
| strength_freq_norm |
-0.3847299 |
-0.3053730 |
0.4401194 |
0.2365039 |
-0.2955944 |
-0.2235990 |
-0.4151050 |
0.4626403 |
0.3956794 |
1.0000000 |
cor.test(data_ego$degree, data_ego$log_constraint)
##
## Pearson's product-moment correlation
##
## data: data_ego$degree and data_ego$log_constraint
## t = -25.146, df = 238, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## -0.8836258 -0.8135519
## sample estimates:
## cor
## -0.8523706
Homophily
People are more accurate when images are of the same race
data_draw <- separate(data_draw, col=image1, into=c(NA,"x"), sep="-", remove=F)
data_draw <- separate(data_draw, col=x, into=c("race1", "sex1"), sep=1, remove=T)
data_draw <- separate(data_draw, col=image2, into=c(NA,"x"), sep="-", remove=F)
data_draw <- separate(data_draw, col=x, into=c("race2", "sex2"), sep=1, remove=T)
data_draw$race_homo <- data_draw$race1==data_draw$race2
data_draw$sex_homo <- data_draw$sex1==data_draw$sex2
accuracy_draw_homo <- ddply(data_draw, .(ID, Structure, Condition, race_homo),
summarise, correct=mean(correct))
mylm <- lmerTest::lmer(correct ~ Structure*race_homo + (1|ID),
data=accuracy_draw_homo)
knitr::kable(anova(mylm))
| Structure |
5.4601667 |
5.4601667 |
1 |
717 |
427.42280 |
0.0000000 |
| race_homo |
0.5164630 |
0.5164630 |
1 |
717 |
40.42881 |
0.0000000 |
| Structure:race_homo |
0.1778519 |
0.1778519 |
1 |
717 |
13.92227 |
0.0002056 |
mymeans <- emmeans::emmeans(mylm, ~Structure*race_homo)
knitr::kable(pairs(mymeans))
| natural,FALSE - unnatural,FALSE |
0.1780556 |
0.0103177 |
717 |
17.257268 |
0.0000000 |
| natural,FALSE - natural,TRUE |
-0.0191667 |
0.0103177 |
717 |
-1.857647 |
0.2474429 |
| natural,FALSE - unnatural,TRUE |
0.1044444 |
0.0103177 |
717 |
10.122828 |
0.0000000 |
| unnatural,FALSE - natural,TRUE |
-0.1972222 |
0.0103177 |
717 |
-19.114915 |
0.0000000 |
| unnatural,FALSE - unnatural,TRUE |
-0.0736111 |
0.0103177 |
717 |
-7.134440 |
0.0000000 |
| natural,TRUE - unnatural,TRUE |
0.1236111 |
0.0103177 |
717 |
11.980475 |
0.0000000 |
mymeans <- emmeans::emmeans(mylm, ~race_homo)
## NOTE: Results may be misleading due to involvement in interactions
knitr::kable(pairs(mymeans))
| FALSE - TRUE |
-0.0463889 |
0.0072957 |
717 |
-6.358365 |
0 |
## Automatically converting the following non-factors to factors: race_homo

accuracy_draw_homo <- ddply(data_draw, .(ID, Structure, Condition, sex_homo),
summarise, correct=mean(correct))
mylm <- lmerTest::lmer(correct ~ Structure*sex_homo + (1|ID),
data=accuracy_draw_homo)
knitr::kable(anova(mylm))
| Structure |
6.8999220 |
6.8999220 |
1 |
717 |
669.9863254 |
0.0000000 |
| sex_homo |
0.0068400 |
0.0068400 |
1 |
717 |
0.6641685 |
0.4153628 |
| Structure:sex_homo |
0.0064455 |
0.0064455 |
1 |
717 |
0.6258593 |
0.4291398 |
Racial homophily affects TP rates in unnatural network (potential ceiling effect in natural network)
No effect on false positive rates
data_draw$sub_reported <- as.numeric(as.logical(data_draw$sub_reported))
report_rates <- ddply(data_draw,
.(ID, Structure, Section, true_structure, race_homo),
summarise,
pos_rate=sum(sub_reported)/length(correct)
)
report_rates[report_rates$true_structure, "rate"] <- "TruePositive"
report_rates[!report_rates$true_structure, "rate"] <- "FalsePositive"
mylm <- lmerTest::lmer(pos_rate ~ rate*Structure*race_homo + (1|ID),
data=report_rates)
knitr::kable(anova(mylm))
| rate |
225.9909777 |
225.9909777 |
1 |
1659.518 |
5428.943204 |
0.0000000 |
| Structure |
0.2541064 |
0.2541064 |
1 |
1659.518 |
6.104356 |
0.0135847 |
| race_homo |
0.4518528 |
0.4518528 |
1 |
1659.464 |
10.854784 |
0.0010062 |
| rate:Structure |
12.0572879 |
12.0572879 |
1 |
1659.464 |
289.650196 |
0.0000000 |
| rate:race_homo |
0.8986488 |
0.8986488 |
1 |
1659.518 |
21.588089 |
0.0000036 |
| Structure:race_homo |
0.1736872 |
0.1736872 |
1 |
1659.518 |
4.172458 |
0.0412439 |
| rate:Structure:race_homo |
0.3162420 |
0.3162420 |
1 |
1659.464 |
7.597028 |
0.0059104 |
mymeans <- emmeans::emmeans(mylm, ~race_homo|rate)
## NOTE: Results may be misleading due to involvement in interactions
knitr::kable(pairs(mymeans))
| FALSE - TRUE |
FalsePositive |
0.0126526 |
0.0131770 |
1655.488 |
0.9602013 |
0.3370941 |
| FALSE - TRUE |
TruePositive |
-0.0743342 |
0.0132994 |
1661.187 |
-5.5892836 |
0.0000000 |
mymeans <- emmeans::emmeans(mylm, ~race_homo|rate*Structure)
knitr::kable(pairs(mymeans))
| FALSE - TRUE |
FalsePositive |
natural |
0.0059727 |
0.0186452 |
1655.826 |
0.3203316 |
0.7487574 |
| FALSE - TRUE |
TruePositive |
natural |
-0.0294121 |
0.0186250 |
1655.149 |
-1.5791704 |
0.1144881 |
| FALSE - TRUE |
FalsePositive |
unnatural |
0.0193326 |
0.0186250 |
1655.149 |
1.0379872 |
0.2994276 |
| FALSE - TRUE |
TruePositive |
unnatural |
-0.1192563 |
0.0189896 |
1666.953 |
-6.2800774 |
0.0000000 |
mymeans <- emmeans::emmeans(mylm, ~Structure|rate*race_homo)
knitr::kable(pairs(mymeans))
| natural - unnatural |
FalsePositive |
FALSE |
-0.1428654 |
0.0186250 |
1655.149 |
-7.670605 |
0 |
| natural - unnatural |
TruePositive |
FALSE |
0.2273633 |
0.0186250 |
1655.149 |
12.207399 |
0 |
| natural - unnatural |
FalsePositive |
TRUE |
-0.1295055 |
0.0186452 |
1655.826 |
-6.945766 |
0 |
| natural - unnatural |
TruePositive |
TRUE |
0.1375191 |
0.0189896 |
1666.953 |
7.241801 |
0 |
## Automatically converting the following non-factors to factors: race_homo, rate
